package com.ssm.wzl.test;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/7/26 0026.
 */
public class num {

    public static void main(String[] arg) throws IOException {
//            System.out.println("请输入：");
//            int  s= System.in.read();
//            sss(1);

        testPageVar2(17,50,30);


    }

    private static int d = 0;

    public static void sss(int dd) {


        int s = 3;

        int yy = 5;

        if (dd > s){
            return;
        }
        if (s < yy){
            yy = s;
        }

        if (dd > 3 && dd <= s-2) {
            d = dd -3;

        }else if (dd > s -2){

            d = dd -(yy - (s - dd));

        }
        for (int i = 0; i < yy; i++) {
            d += 1;
            System.out.print(d + ",");
        }
    }



    public static void testPageVar2(int pageNow, int pageCount, int continuePage) {
        List<Object> list = new ArrayList();
        Integer falg = 0;
//        this.checkPageMore(list, pageNow, pageCount,1);
        if (pageNow > pageCount){
            return;
        }
        if (continuePage > pageCount){
            continuePage = pageCount;
        }
        if (pageNow > (continuePage/2 + 1) && pageNow <= (pageCount - continuePage/2)) {
            falg = pageNow - (continuePage/2 + 1);
        }else if (pageNow > (pageCount - continuePage/2)){
            falg = pageNow -(continuePage - (pageCount - pageNow));
        }
        int result = pageCount > continuePage ? continuePage : pageCount;
        for (int i = 0; i < continuePage; i++) {
            falg += 1;
            list.add(falg);
        }

//        this.checkPageMore(list, pageNow, pageCount,2);
        System.out.println(list);
    }
}
